(function (a) {
  a("#mobile-menu-active").meanmenu({meanScreenWidth: "991", meanMenuContainer: ".mobile-menu-area .mobile-menu",});
  a(".icon-cart").on("click", function () {
    a(this).parent().find(".shopping-cart-content").slideToggle("medium")
  });
  var e = a(".search-toggle");
  e.on("click", function () {
    if (a(this).hasClass("open")) {
      a(this).removeClass("open");
      a(this).siblings(".search-content").removeClass("open")
    } else {
      a(this).addClass("open");
      a(this).siblings(".search-content").addClass("open")
    }
  });
  a(".slider-active").owlCarousel({
    loop: true,
    navText: ['<i class="icon-arrow-left"></i>', '<i class="icon-arrow-right"></i>'],
    nav: true,
    autoplay: false,
    autoplayTimeout: 5000,
    animateOut: "fadeOut",
    animateIn: "fadeIn",
    item: 1,
    responsive: {0: {items: 1}, 768: {items: 1}, 1000: {items: 1}}
  });
  new WOW().init();
  var c = a(".cart-plus-minus");
  c.prepend('<div class="dec qtybutton">-</div>');
  c.append('<div class="inc qtybutton">+</div>');
  a(".qtybutton").on("click", function () {
    var h = a(this);
    var j = h.parent().find("input").val();
    if (h.text() === "+") {
      var i = parseFloat(j) + 1
    } else {
      if (j > 0) {
        var i = parseFloat(j) - 1
      } else {
        i = 1
      }
    }
    h.parent().find("input").val(i)
  });
  var f = a("#slider-range");
  var b = a("#amount");
  a(function () {
    f.slider({
      range: true, min: 0, max: 1200, values: [35, 540], slide: function (h, i) {
        b.val("$" + i.values[0] + " - $" + i.values[1])
      }
    });
    b.val("$" + f.slider("values", 0) + " - $" + f.slider("values", 1))
  });
  a(".view-mode li a").on("click", function () {
    var h = a(this).data("view");
    a(".view-mode li").removeClass("active");
    a(this).parent("li").addClass("active");
    a(".product-view").removeClass("product-grid product-list").addClass(h)
  });
  a(".count").counterUp({delay: 10, time: 1000});
  a(".product-dec-slider").owlCarousel({
    loop: true,
    autoplay: false,
    autoplayTimeout: 5000,
    navText: ['<i class="ti-arrow-left"></i>', '<i class="ti-arrow-right"></i>'],
    nav: true,
    item: 4,
    margin: 12,
    responsive: {0: {items: 2}, 576: {items: 3}, 768: {items: 3}, 1000: {items: 4}}
  });
  a(".related-product-active").owlCarousel({
    loop: true,
    autoplay: false,
    autoplayTimeout: 5000,
    nav: false,
    item: 4,
    margin: 30,
    responsive: {0: {items: 1}, 576: {items: 2}, 768: {items: 3}, 1000: {items: 4}}
  });
  a("#zoompro").elevateZoom({
    gallery: "gallery",
    galleryActiveClass: "active",
    zoomWindowWidth: 300,
    zoomWindowHeight: 100,
    scrollZoom: false,
    zoomType: "inner",
    cursor: "crosshair"
  });
  var d = a(".transparent-bar");
  var g = a(window);
  g.on("scroll", function () {
    var h = g.scrollTop();
    if (h < 200) {
      d.removeClass("stick")
    } else {
      d.addClass("stick")
    }
  });
  a.scrollUp({scrollText: '<i class="ti-arrow-up"></i>', easingType: "linear", scrollSpeed: 900, animation: "fade"});
  a("[data-countdown]").each(function () {
    var h = a(this), i = a(this).data("countdown");
    h.countdown(i, function (j) {
      h.html(j.strftime('<span class="cdown day">%-D <p>Days</p></span> <span class="cdown hour">%-H <p>Hour</p></span> <span class="cdown minutes">%M <p>Min</p></span class="cdown second"> <span>%S <p>Sec</p></span>'))
    })
  });
  a(".testimonial-text-slider").slick({
    slidesToShow: 1,
    slidesToScroll: 1,
    arrows: false,
    draggable: false,
    fade: true,
    asNavFor: ".slider-nav",
  });
  a(".testimonial-image-slider").slick({
    slidesToShow: 3,
    slidesToScroll: 1,
    asNavFor: ".testimonial-text-slider",
    dots: false,
    arrows: false,
    centerMode: true,
    focusOnSelect: true,
    centerPadding: "0px",
    responsive: [{breakpoint: 767, settings: {dots: false, centerPadding: "0px",}}, {
      breakpoint: 420,
      settings: {autoplay: true, dots: false, slidesToShow: 1, centerMode: false,}
    }]
  })
})(jQuery);
